<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

<head>
  <title>CGU - Time - strftime / strfutc</title>
  <link rel="stylesheet" type="text/css" href="main.css" />
</head>

<body>

<div id="head">
  <div id="title">
    <h1>CGU</h1>&nbsp;&nbsp;<h2>Common &amp; General Use JavaScript</h2>
  </div>
</div>

<div id="foot">
  <div id="copy">
    <span>&copy; 2008 CGU</span>
  </div>
</div>

<div id="body">
  <div id="nav">
    <div class="pad">
      
      <div class="navlist">
        <h3>CGU</h3>
        <ul>
          <li><a href="index.html">Docs Home</a></li>
          <li><a href="functions.html">Functions</a></li>
        </ul>
      </div>
      
      <div class="navlist">
        <h3>Time</h3>
        <ul>
          <li><a href="function.local-utc.html">local</a></li>
          <li><a href="function.phpdate.html">phpdate</a></li>
          <li><a href="function.phpdate.html">phputc</a></li>
          <li class="active"><a href="function.strftime.html">strftime</a></li>
          <li class="active"><a href="function.strftime.html">strfutc</a></li>
          <li><a href="function.local-utc.html">utc</a></li>
        </ul>
      </div>
      
      <div class="navlist">
        <h3>Utilities</h3>
        <ul>
          <li><a href="utility.Cookie.html">Cookie</a></li>
          <li><a href="utility.Crypto.html">Crypto</a></li>
          <li><a href="utility.JSON.html">JSON</a></li>
          <li><a href="utility.Query.html">Query</a></li>
          <li><a href="utility.Time.html">Time</a></li>
          <li><a href="utility.Type.html">Type</a></li>
        </ul>
      </div>
      
    </div>
  </div>
  
  <div id="docs">
    <div class="pad">
      <div id="content">
<!-- Start: Content -->
      
      <h1>Time</h1>
      
      <hr />
      
      <h2>strftime / strfutc</h2>
      
      <blockquote>
        <p>C/C++ date formatting in local and UTC time.</p>
      </blockquote>
      
      <hr />
      
      <h3>Syntax</h3>
      
      <blockquote>
        <pre class="prettify"><code><span class="pln">CGU</span><span class="pun">.</span><span class="pln">strftime</span><span class="pun">(</span><span class="pln">format </span><span class="pun">[,</span><span class="pln"> time</span><span class="pun">])</span></code></pre>
        <pre class="prettify"><code><span class="pln">CGU</span><span class="pun">.</span><span class="pln">strfutc</span><span class="pun">(</span><span class="pln">format </span><span class="pun">[,</span><span class="pln"> time</span><span class="pun">])</span></code></pre>
        
        <blockquote>
          <p><code><b>format</b> &lt;String&gt;</code>: A string representing the date format.</p>
          <blockquote>
            <p>
              <code>%a</code> - Abbreviated week. <code>(Sun - Sat)</code><br />
              <code>%A</code> - Full week. <code>(Sunday - Saturday)</code><br />
              <code>%b</code> - Abbreviated month. <code>(Jan - Dec)</code><br />
              <code>%B</code> - Full month. <code>(January - December)</code><br />
              <code>%c</code> - Locale date and time. <code>(based on Date#toLocaleString)</code><br />
              <code>%C</code> - Century. <code>(year / 100)</code><br />
              <code>%d</code> - Day of the month with leading zeros.<br />
              <code>%D</code> - Equivalent to <code>"%m/%d/%y"</code>.<br />
              <code>%e</code> - Day of the month with leading spaces.<br />
              <code>%E</code> - <b>[unsupported]</b> POSIX locale extensions.<br />
              <code>%F</code> - Equivalent to <code>"%Y-%m-%d"</code>.<br />
              <code>%g</code> - 2-digit year containing majority of the Monday-start week.<br />
              <code>%G</code> - 4-digit year containing majority of the Monday-start week.<br />
              <code>%h</code> - <code>%b</code><br />
              <code>%H</code> - Hour of 24-hour clock with leading zeros.<br />
              <code>%I</code> - Hour of 12-hour clock with leading zeros.<br />
              <code>%j</code> - Day of the year with leading zeros. <code>(000 - 366)</code><br />
              <code>%k</code> - Hour of 24-hour clock with leading spaces.<br />
              <code>%l</code> - Hour of 12-hour clock with leading spaces.<br />
              <code>%m</code> - Numeric month with leading zeros.<br />
              <code>%M</code> - Minutes with leading spaces.<br />
              <code>%n</code> - newline.<br />
              <code>%N</code> - Milliseconds with leading zeros.<br />
              <code>%O</code> - <b>[unsupported]</b> POSIX locale extensions.<br />
              <code>%p</code> - Uppercase ante meridiem or post meridiem.<br />
              <code>%P</code> - Lowercase ante meridiem or post meridiem.<br />
              <code>%r</code> - Equivalent to <code>"%I:%M:%S %p"</code>.<br />
              <code>%R</code> - Equivalent to <code>"%H:%M"</code>.<br />
              <code>%s</code> - Seconds since Unix Epoch.<br />
              <code>%S</code> - Seconds with leading zeros.<br />
              <code>%t</code> - tab.<br />
              <code>%T</code> - Equivalent to <code>"%H:%M:%S"</code>.<br />
              <code>%u</code> - Day of the week. <code>(1 - 7 <=> Mon - Sun)</code><br />
              <code>%U</code> - Week number of the year, Sunday-start, with leading zeros.<br />
              <code>%v</code> - Equivalent to <code>"%e-%b-%Y"</code>.<br />
              <code>%V</code> - Week number of <code>%G</code> year, Monday-start, with leading zeros.<br />
              <code>%w</code> - Day of the week. <code>(0 - 6 <=> Sun - Sat)</code><br />
              <code>%W</code> - Week number of the year, Monday-start, with leading zeros.<br />
              <code>%x</code> - Locale date. <code>(based on Date#toLocaleDateString)</code><br />
              <code>%X</code> - Locale time. <code>(based on Date#toLocaleTimeString)</code><br />
              <code>%y</code> - 2-digit year.<br />
              <code>%Y</code> - 4-digit year.<br />
              <code>%z</code> - Offset from UTC. <code>(e.g. -0600)</code><br />
              <code>%Z</code> - <b>[unsupported]</b> Timezone name.<br />
              <code>%%</code> - Percent sign.<br />
            </p>
          </blockquote>
          
          <p><code><b>time</b> &lt;Date&gt;</code>: A date to format.</p>
          <blockquote>
            <p><code>&lt;Number&gt;</code>: Unix Epoch time in milliseconds.</p>
            <p><code>&lt;null&gt;</code>: Use current time.</p>
          </blockquote>
      </blockquote>
      
      <h3>Return</h3>
      
      <blockquote>
        <p><code>&lt;String&gt;</code>: A formatted date string.</p>
        <blockquote>
          <p><code>&lt;null&gt;</code>: Out of range: Jan 1, 0000 to Dec 31, 9999..</p>
          <p><code>&lt;undefined&gt;</code>: Invalid <code>time</code>.</p>
        </blockquote>
      </blockquote>
      
      <hr />
      
<!-- Final: Content -->
      </div>
    </div>
  </div>
</div>

  <script type="text/javascript" src="main.js"></script>
</body>

</html>
